package com.ibeetl.admin.aod.web.query;

import com.ibeetl.admin.core.annotation.Query;
import com.ibeetl.admin.core.util.Tool;
import com.ibeetl.admin.core.util.enums.CoreDictType;
import com.ibeetl.admin.core.web.query.PageParam;
import lombok.Data;
import org.apache.commons.lang3.StringUtils;

import java.util.Date;

/**
 * 筛查查询
 */
@Data
public class FilterQuery extends PageParam {

    @Query(name = "文件名称", display = true)
    private String fileName;

    @Query(name = "处理状态", display = true, type = Query.TYPE_DICT, dict = CoreDictType.PROCESS_STATUS)
    private Integer processStatus;

    @Query(name = "创建时间", display = true, type = Query.TYPE_DATE_BETWEEN)
    private String createDateRange;

    private Date createDateMin;

    private Date createDateMax;

    public void setCreateDateRange(String createDateRange) {
        this.createDateRange = createDateRange;
        if(StringUtils.isEmpty(createDateRange)) {
            return ;
        }
        Date[] ds = Tool.parseDataRange(createDateRange);
        this.createDateMin=ds[0];
        this.createDateMax =ds[1];
    }


    @Query(name = "筛查方式", display = true, type = Query.TYPE_DICT, dict = CoreDictType.FILTER_TYPE)
    private Integer importType;

    @Query(name = "账号名称", display = true)
    private String account;

    @Query(name = "行业标识", display = true, type = Query.TYPE_DICT, dict = CoreDictType.INDUSTRY_FLAG)
    private Integer industryFlag;

    @Query(name = "行业类别", display = true, type = Query.TYPE_INDUSTRY)
    private Long industryId;

    @Query(name = "关键词", display = true, type = Query.TYPE_INDUSTRY_KEYWORD)
    private String keywordId;

    private Integer filterFlag = 1;

}
